-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
92 automatic profile creation for new user #111
92 automatic profile creation for new user #111
Conversation
…wing up on the git stage which is unnerving.
This is a deep-dive into Administrate that I find intimidating and am not excited about at all. Can I put this on hold and we pair on this sometime early next week, @sumeetjain ? |
…revents page load for new user form in admin dashboard.
…ion select form field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a question and some notes for things to improve.
@@ -3,6 +3,7 @@ source "https://rubygems.org" | |||
ruby "2.3.0" | |||
|
|||
gem "administrate", "~> 0.2.2" | |||
gem "administrate-field-nested_has_many", "~> 0.0.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this gem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think so!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
(upcoming.length > 0) ? upcoming[0].id : nil | ||
end | ||
|
||
def self.upcoming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out ActiveRecord scopes. This functionality would be better as a scope inside this model than it is as a class method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
@@ -1,4 +1,13 @@ | |||
class Cohort < ActiveRecord::Base | |||
has_many :profiles | |||
has_many :users, through: :profiles | |||
|
|||
def self.next | |||
(upcoming.length > 0) ? upcoming[0].id : nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning the ID is perhaps what you needed for this particular task, but for the purposes of building the API for Cohort
, it'd be more useful (and no less computational effort for Ruby) to return the entire Cohort object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
Made the changes you requested, though not sure how to dismiss the "Changes requested" message. |
Fixes #92
Login Credentials
Your GH profile. You should be able to create an "Admin" user to test this functionality.
Functionality to Test